using System;
using System.Collections.Generic;

namespace SmartBoard.Background.Dialogs
{
    public class DialogManager
    {
        private IDictionary<Type, Type> _interfaceToClassMapping;

        #region [Singleton]
        private static DialogManager _instance = null;

        private DialogManager()
        {
            _interfaceToClassMapping = new Dictionary<Type, Type>();
            _interfaceToClassMapping.Add(typeof(IChangeBackgroundDialog),typeof(ChangeBackgroundDialog));
        }

        public static DialogManager Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new DialogManager();
                return _instance;
            }
        }

        #endregion

        public object GetDialog(Type type)
        {
            return Activator.CreateInstance(_interfaceToClassMapping[type]);
        }
    }
}